from molel.IVTUdelft import *
from molel.doReport import *
from molel.IETS import *
from pylab import *
import molel.IETS
from os import chdir
chdir("/home/fock/phD/data/MCBJ")
m = IVTUdelft()
m.loadMCBJ('rawdata/100820-jks113/14-18_10K/IV100830_16_',force=0)
m.rotate(-9);m.correct_offset()


reload(molel.IETS);iets=molel.IETS.IETS(m);iets.findpeaks();iets.selectPeaks(usebothMUX=False,maxpeaks=100);#iets.analyseFoundPeaks()
iets.plotIETS_peak_hist();close('all')
iets.printTraces();close('all')

iets.printpeakstraces()

iets.plotPeakIM()
iets.printTraces()
m.SavedTraces

m.PlotSingle(9,twin=0)
from pylab import *

doReport(m)

iv = IETS('100820-jks113/14-18_10K/','',force=force)
iv.plotSingle_IETS(87,-9,nfitlength=11,twin=False)
iv.rotate(-9);




import molel.mcbj
from os import chdir
chdir("/home/fock/phD/data/MCBJ")
reload(molel.mcbj);m=molel.mcbj()
m.loadfiles(filenames='rawdata/091124-jks113-newsetup/15-19/scan091129_8_*.dat',findbreakpoints=molel.mcbj.FindBreakPoints(dGthreashold=0.5,Gthreashold=1.1,GminBreak=.9),force=False) 
rcParams['font.size']=20
clf();
axes([0,0,1,0.5])
m.Plot2D_corr()

axes([0.12,0.15,.20,.8])
m.plot2Dhist(log=1,Plot1D=0,xval=[-.1,.5])
axes([0.40,0.15,.55,.8])
m.correlate(m.brake,10**linspace(log10(m.bins[0]),log10(m.bins[-1]),100),rollavg_n=1)
